//
//  HZ_refsArray.m
//  HZ_Beautiful_Music
//
//  Created by dllo on 16/4/5.
//  Copyright © 2016年 ui. All rights reserved.
//

#import "HZ_refsArray.h"
#import "HZ_songs_Model.h"
@implementation HZ_refsArray
-(instancetype)initWithDataSource:(NSDictionary *)dataSource{
    
    self = [super init];
    
    
    if (self) {
        
        [self setValuesForKeysWithDictionary:dataSource];
        
        NSMutableArray *array = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.songs) {
            
            HZ_songs_Model *refs = [[HZ_songs_Model alloc] init];
            
            [refs setValuesForKeysWithDictionary:dic];
            [array addObject:refs];
            
            
        }
        
        
        self.songs = [NSArray arrayWithArray:array];
        
        NSLog(@"////%@", self.songs);
    }
    
    return self;
    

    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    if ([key isEqual:@"image"]) {
        
        self.images  = [[HZ_imageModel alloc] init];
        
        
        
        [self.images setValuesForKeysWithDictionary:value];
        
        
    }
    
    
    
    
    
}

@end
